@extends("layouts.admin")
@section("content")
    <!--面包屑导航 开始-->
	<!--面包屑导航 结束-->

	<!--结果集标题与导航组件 开始-->
	<div class="result_wrap">
        <div class="result_title">
            <h3>快捷操作</h3>
            <div class="mark">
        @if(count($errors)>0)
        @foreach($errors->all() as $error)
        	<p style="color:red">{{$error}}</p>
        @endforeach
        @endif
        	@if(session('msg'))
    			<p style="color:red">{{session('msg')}}</p>
    		@endif
        </div>
        </div>
        <div class="result_content">
            <div class="short_wrap">
                <a href="{{url('admin/category/create')}}"><i class="fa fa-plus"></i>新增分类</a>
                <a href="#"><i class="fa fa-recycle"></i>批量删除</a>
                <a href="#"><i class="fa fa-refresh"></i>更新排序</a>
            </div>
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->
    
    <div class="result_wrap">
        <form action="{{url('admin/category/'.$cate['cate_id'].'')}}" method="post">
        {{csrf_field()}}
         <input type="hidden" name="_method" value="PUT">
            <table class="add_tab">
                <tbody>
                    <tr>
                        <th width="120"><i class="require">*</i>父级分类：</th>
                        <td>
                            <select name="cate_pid">
                                <option value="0">==顶级分类==</option>
                                @foreach($data as $val)
                                @if($cate['cate_pid']==$val['cate_id'])
                                <option selected value="{{$val['cate_id']}}">{{$val['seperator']}}{{$val['cate_name']}}</option>
                                @else
                                <option value="{{$val['cate_id']}}">{{$val['seperator']}}{{$val['cate_name']}}</option>
                                @endif
                                @endforeach
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require">*</i>分类名称：</th>
                        <td>
                            <input type="text" name="cate_name" value="{{$cate['cate_name']}}">
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require">*</i>分类标题：</th>
                        <td>
                            <input type="text" name="cate_title" value="{{$cate['cate_title']}}">
                        </td>
                    </tr>
                    <tr>
                        <th>关键字：</th>
                        <td><input type="text" name="cate_keywords" value="{{$cate['cate_keywords']}}"></td>
                    </tr>
                    <tr>
                        <th>分类描述：</th>
                        <td>
                            <textarea name="cate_description">{{$cate['cate_description']}}</textarea>
                        </td>
                    </tr>
                     <tr>
                        <th>排序：</th>
                        <td><input type="text" name="cate_order" value="{{$cate['cate_order']}}"></td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input type="submit" value="提交">
                            <input type="button" class="back" onclick="history.go(-1)" value="返回">
                        </td>
                    </tr>
                </tbody>
            </table>
        </form>
    </div>
@endsection